<?php
namespace Home\Controller;

/**
* 读取地区
*/
class AreaController extends CommonController {
	protected $table = "area_info";
	/*原来的不使用接口文件调用crm省市区县的查询方式*/
/*	public function getAreasByPid(){
		$pid = I('get.pid',1);
		$list = $this->M->where(array("p_id"=>$pid))->select();
		$this->ajaxReturn($list);
        // echo json_decode($list);
	}*/
	public function getAreasByPid(){
		//$pid = I('get.pid',1);
		$pid = array("pid"=>I('get.pid',1));
		$getareasbypid_url = "Area/getAreasByPid";
	    $list = json_decode(http_post($getareasbypid_url,$pid),true);
		$this->ajaxReturn($list["list"]);
        // echo json_decode($list);
	}
	 
}